
package galaxy.app.dispatch.disruptor;

import com.lmax.disruptor.ExceptionHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import galaxy.app.log.LogHelper;

/**
 */
public class ErrorHandler<T> implements ExceptionHandler<T> {

    @Override
    public void handleEventException(Throwable ex, long sequence, T event) {
        LogHelper.error("{}", ex);
        LogHelper.error("buffer = {}", event);
    }

    @Override
    public void handleOnStartException(Throwable ex) {
        LogHelper.error("{}", ex);
    }

    @Override
    public void handleOnShutdownException(Throwable ex) {
        LogHelper.error("{}", ex);
    }
}
